export function fetchWithTimeout(url: string, options = {}, timeout = 300000) { // 5分钟
    const controller = new AbortController();
    const id = setTimeout(() => controller.abort(), timeout);

    return fetch(url, {
        ...options,
        signal: controller.signal
    }).finally(() => {
        clearTimeout(id);
    });
}
